import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [{
    path: "/",
    redirect: "/Home/index",
  },
  {
    path: "/",
    name: "Home",
    component: Home,
    redirect: "/Home/Index",
    children: [{
        path: "/Home/index",
        name: "Index",
        component: () => import("../views/Home/Index.vue"),
      },
      {
        path: "/Home/userList",
        name: "userList",
        component: () => import("../views/Home/userList.vue"),
      },
      {
        path: "/Home/shopList",
        name: "shopList",
        component: () => import("../views/Home/shopList.vue"),
      },
      {
        path: "/Home/foodList",
        name: "foodList",
        component: () => import("../views/Home/foodList.vue"),
      },
      {
        path: "/Home/oriderList",
        name: "oriderList",
        component: () => import("../views/Home/oriderList.vue"),
      },
      {
        path: "/Home/adminList",
        name: "adminList",
        component: () => import("../views/Home/adminList.vue"),
      },
      {
        path: "/Home/addShop",
        name: "addShop",
        component: () => import("../views/Home/addShop.vue"),
      },
      {
        path: "/Home/addPrice",
        name: "addPrice",
        component: () => import("../views/Home/addPrice.vue"),
      },
      {
        path: "/Home/edit",
        name: "edit",
        component: () => import("../views/Home/edit.vue"),
      },
      {
        path: "/Home/visitor",
        name: "visitor",
        component: () => import("../views/Home/visitor.vue"),
      },
      {
        path: "/Home/explain",
        name: "explain",
        component: () => import("../views/Home/explain.vue"),
      },
      {
        path: "/Home/adminSet",
        name: "adminSet",
        component: () => import("../views/Home/adminSet.vue"),
      },
    ],
  },
  {
    path: "/about",
    name: "About",
    component: () => import("../views/About.vue"),
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;